from itertools import combinations
n = str(input())
res = 0
for c in combinations(range(1,len(n)), 3):
    x1 = n[:c[0]]
    x2 = n[c[0]:c[1]]
    x3 = n[c[1]:c[2]]
    x4 = n[c[2]:]
    if int(x1) < 255 and int(x2) < 255 and int(x3) < 255 and int(x4) < 255:
        res+=1
print(res)







